from app import db

class Container(db.Model):
    id = db.Column(db.String(64), primary_key=True)
    name = db.Column(db.String(128), nullable=False)
    image = db.Column(db.String(128), nullable=False)
    status = db.Column(db.String(64), nullable=False)
    created = db.Column(db.DateTime, nullable=False)

    def to_dict(self):
        return {
            "id": self.id,
            "name": self.name,
            "image": self.image,
            "status": self.status,
            "created": self.created.isoformat()
        }